Specification languages are formal languages used during software development to describe what the system is supposed to do without unnecessary details about how it is to be accomplished. Many of these specification languages have a visual representation, e.g. a graph, which is designed to make them more accessible and improve readability.
FIG. 1A provides an example of a graph representation of a specification language in the form of a finite state machine, which may e.g. be employed by a computer game software developer. Specifically, the example provided in FIG. 1A illustrates a virtual shooting game in which game characters may execute specific behaviors based on their environment. Each circle 11, 13 and 15 may represent an action taken by the game character, while the transitions between actions may be provided by data indications represented by directed edges 12, 14, 16 and 18.
Thus, in the example provided by FIG. 1A, a game character may initially be configured to perform the patrol action 11. If the game character receives a data indication that a visual of a target has been obtained and the target is not close 12, the game character may transition to the shooting action 13. If a data indication specifies that a target visual is no longer obtained 14, the game character may transition back to a patrol action 11. Similarly, if the game character is currently executing a patrol action 11 and a data indication that a target visual which is close 18 is obtained, the game character may transition to a stabbing action 15. Once a data indication is received that a target visual is no longer obtained 16, the game character may transition back to a patrol action 11. Finally, if the game character is currently in the shoot action 13, and a data indication that the target is close 17 is obtained, then it may transition to the stab action 15. Conversely, if the game character is currently in the stab action 15, and a data indication that the target is not close 19 is obtained, then it may transition to the shoot action 13.
FIG. 1B provides another example of a graph representation of a specification language in the form of a decision tree. In the decision tree of FIG. 1B, data indications are represented by decision nodes 20 and 22, while actions are represented by leaf nodes 21, 23, and 25. Transitions from decision nodes to leaf nodes may be provided by the directed edges interconnecting the nodes.
Initially, a game character may be configured to wait for a data indication as to whether or not a visual of a target is obtained 20. If the decision from the visual data indicator 20 is negative, the game character may be configured to execute a patrol command 21. Thereafter, the game character may be configured to restart this transition process from the root node 20 of the decision tree. If the decision from the visual data indicator 20 is positive the game character may transition to a second data indication where a determination of whether or not the target is close may be made 22. If the decision from the closeness data indicator 22 is positive, the game character may transition to a shooting action 25 and thereafter restart at the root node 20. If the decision from the closeness data indicator 22 is negative, the game character may transition to a stabbing action 23 and thereafter restart at the root node 20.